define(['jquery', 'bootstrap', 'backend', 'table', 'vue', 'echarts', 'echarts-theme'], function($, undefined, Backend,Table, Vue, Echarts) {

	var Controller = {
		index: function() {
			var courseChart = Echarts.init($('#course-chart')[0], 'walden');
			courseChart.setOption({
				legend: {data: ['课程订单', '会员卡订单','商品订单']},
				tooltip: {trigger: 'axis',formatter: "{b}<br>{a0} : {c0} 个 <br>{a1} : {c1} 个 <br>{a2} : {c2} 个"},
				toolbox: {show: true,feature: {magicType: {show: true,type: ['line','bar']},restore: {show: true},saveAsImage: {show: true}}},
				calculable: true,
				xAxis: [
					{
						type: 'category',
						data: Config.weekDays
					}
				],
				yAxis: [
					{type: 'value'}
				],
				yAxis: [
					{type: 'value'}
				],
				series: [
					{	
						name: '课程订单',
						type: 'line',
						data: Config.courseDayTotalNum,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					},
					{
						name: '会员卡订单',
						type: 'line',
						smooth: true,
						symbol: 'none',
						data: Config.vipDayTotalNum,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					},
					{
						name: '商品订单',
						type: 'line',
						smooth: true,
						symbol: 'none',
						data: Config.goodsDayTotalNum,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					}
				]
			});

			var vipChart = Echarts.init($('#vip-chart')[0], 'walden');
			vipChart.setOption({
				legend: {data: ['课程订单', '会员卡订单','商品订单']},
				tooltip: {trigger: 'axis',formatter: "{b}<br>{a0} : {c0} 元 <br>{a1} : {c1} 元 <br>{a2} : {c2} 元"},
				toolbox: {show: true,feature: {magicType: {show: true,type: ['line','bar']},restore: {show: true},saveAsImage: {show: true}}},
				calculable: true,
				xAxis: [
					{
						type: 'category',
						data: Config.weekDays
					}
				],
				yAxis: [
					{type: 'value'}
				],
				yAxis: [
					{type: 'value'}
				],
				series: [
					{	
						name: '课程订单',
						type: 'bar',
						data: Config.courseDayTotalMoney,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					},
					{
						name: '会员卡订单',
						type: 'bar',
						smooth: true,
						symbol: 'none',
						data: Config.vipDayTotalMoney,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					},
					{
						name: '商品订单',
						type: 'bar',
						smooth: true,
						symbol: 'none',
						data: Config.goodsDayTotalMoney,
						markPoint: {data: [{type: 'max',name: '最大值'},{type: 'min',name: '最小值'}]}
					}
				]
			});
		},
		api: {
			bindevent: function() {
				Form.api.bindevent($("form[role=form]"));
			}
		}
	};
	return Controller;
});
